package com.caituo.idouyou.user.system.interceptor;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.caituo.idouyou.user.common.exception.UnLoginException;
import com.caituo.idouyou.user.common.util.HttpUtil;
import com.caituo.idouyou.user.service.LoginService;
import com.caituo.idouyou.user.service.Impl.LoginServiceImpl;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class LoginInterceptor extends AbstractInterceptor{

	@Override
	public void init() {
		super.init();
	}

	@Override
	public void destroy() {
		super.destroy();
	}

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		String string =null;
		try {
			LoginService loginService = new LoginServiceImpl();
			loginService.isLogin();
			string = invocation.invoke();
		} catch (Exception e) {
			HttpUtil.retExceptionString(e);
		}
		return string;
	}

}
